/* eslint-disable react/react-in-jsx-scope */

import styles from './index.module.scss'
type Props = {
    hideList:()=>void
    type:'' | 'gender' | 'photo'
    onUpdate:(type:string, value:string)=>void
}

const genderList = [
  { title: '男', value: '0' },
  { title: '女', value: '1' }
]

// const photoList = [
//   { title: '拍照', value: '' },
//   { title: '本地选择', value: '' }
// ]
const EditList = ({ hideList, type, onUpdate }:Props) => {
  return (
        <div className={styles.root}>
             {/* <div className="list-item">男</div>
             <div className="list-item">女</div> */}
           {type === 'gender'
             ? genderList.map(it => (<div key={it.value} className='list-item' onClick={() => onUpdate('gender', it.value)}>{it.title}</div>))
             : (
            <><div className="list-item" onClick={() => onUpdate('photo', '')}>拍照</div><div className="list-item" onClick={() => onUpdate('photo', '')}>上传</div></>
               )}
             <div className="list-item" onClick={hideList}>取消</div>
        </div>
  )
}
export default EditList
